package com.usian.mapper.staff;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.usian.pojo.staff.Staff;
import com.usian.vo.StaffVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

public interface StaffMapper extends BaseMapper<Staff> {

    @Select("SELECT s.*,d.dname,p.pname from staff s,dep d,poste p where s.posteid=p.pid and s.depid=d.did")
    public List<StaffVo> findAll();

    @Select("SELECT count(s.id) FROM staff s,dep d,poste p where s.posteid=p.pid and s.depid=d.did and s.depid=${depid}")
    public int findById(@Param("depid") Integer depId);
}
